Skip to content

[ALICE3,PWGDQ,PWGEM] Fix linter errors/warnings concerned with DQ cuts - #18796

Open
axti98 wants to merge 2 commits into
AliceO2Group:masterfrom
axti98:UpdateCutsLibrary
Open

axti98 wants to merge 2 commits into
AliceO2Group:masterfrom
axti98:UpdateCutsLibrary

Conversation

@axti98

@axti98 axti98 commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes several O2 linter errors and warnings concerned with the PWGDQ cuts library. The primary change is in renaming the functions in the Analysis(Composite)Cut and CutsLibrary.

@github-actions

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 2210 warnings, 🔕 93 disabled

@feisenhu

Copy link
Copy Markdown
Collaborator

Seems ok from my side.

@alibuild

alibuild commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 25c66b2 at 2026-11-18 12:22:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 5 errors and 741 warnings.'
Found 5 errors and 741 warnings.
++ [[ 5 -gt 0 ]]
++ cat /sw/BUILD/638fc48eb09a76ca7e326a418eb9a05e3b8c85e8/O2Physics-code-check/errors.txt
PWGDQ/Core/AnalysisCompositeCut.h:40:7: error: Forming reference to null pointer [clang-analyzer-core.NonNullParamChecker,-warnings-as-errors]
PWGDQ/Core/CutsLibrary.cxx:31:1: error: included header RtypesCore.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGDQ/TableProducer/tableMaker_withAssoc.cxx:49:1: error: included header Digit.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGDQ/TableProducer/tableMaker_withAssoc.cxx:77:1: error: included header bitset is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGDQ/Tasks/tableReader_withAssoc.h:354:86: error: no header providing "o2::constants::lhc::LHCRevFreq" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 741 -gt 0 ]]
++ cat /sw/BUILD/638fc48eb09a76ca7e326a418eb9a05e3b8c85e8/O2Physics-code-check/warnings.txt
ALICE3/Tasks/alice3DqEfficiency.cxx:778:36: warning: initializer for member 'fMCGenAccCut' is redundant [readability-redundant-member-init]
PWGDQ/Core/AnalysisCompositeCut.cxx:23:59: warning: initializer for base class 'AnalysisCut' is redundant [readability-redundant-member-init]
PWGDQ/Core/AnalysisCompositeCut.cxx:25:59: warning: initializer for member 'fCutList' is redundant [readability-redundant-member-init]
PWGDQ/Core/AnalysisCompositeCut.cxx:26:59: warning: initializer for member 'fCompositeCutList' is redundant [readability-redundant-member-init]
PWGDQ/Core/AnalysisCompositeCut.cxx:36:96: warning: initializer for member 'fCutList' is redundant [readability-redundant-member-init]
PWGDQ/Core/AnalysisCompositeCut.cxx:37:96: warning: initializer for member 'fCompositeCutList' is redundant [readability-redundant-member-init]
PWGDQ/Core/AnalysisCompositeCut.cxx:81:8: warning: use auto when declaring iterators [modernize-use-auto]
PWGDQ/Core/AnalysisCompositeCut.cxx:90:8: warning: use auto when declaring iterators [modernize-use-auto]
PWGDQ/Core/AnalysisCompositeCut.cxx:100:12: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
PWGDQ/Core/AnalysisCompositeCut.cxx:101:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGDQ/Core/AnalysisCompositeCut.h:44:3: warning: function 'getUseAND' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGDQ/Core/AnalysisCompositeCut.h:45:3: warning: function 'getNCuts' should be marked [[nodiscard]] [modernize-use-nodiscard]
PWGDQ/Core/AnalysisCut.cxx:30:65: warning: initializer for member 'fCuts' is redundant [readability-redundant-member-init]
PWGDQ/Core/AnalysisCut.h:138:8: warning: use auto when declaring iterators [modernize-use-auto]
PWGDQ/Core/AnalysisCut.h:159:11: warning: variable 'cutLow' is not initialized [cppcoreguidelines-init-variables]
PWGDQ/Core/AnalysisCut.h:159:19: warning: variable 'cutHigh' is not initialized [cppcoreguidelines-init-variables]
PWGDQ/Core/CutsLibrary.cxx:3663:8: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
PWGDQ/Core/CutsLibrary.cxx:3663:8: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGDQ/Core/CutsLibrary.cxx:7291:8: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
PWGDQ/Core/CutsLibrary.cxx:7291:8: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGDQ/Core/CutsLibrary.cxx:7944:33: warning: use 'contains' to check for membership [readability-container-contains]
PWGDQ/Core/CutsLibrary.cxx:7974:35: warning: use 'contains' to check for membership [readability-container-contains]
PWGDQ/Core/CutsLibrary.cxx:7981:35: warning: use 'contains' to check for membership [readability-container-contains]
PWGDQ/Core/CutsLibrary.cxx:7992:35: warning: use 'contains' to check for membership [readability-container-contains]
PWGDQ/Core/CutsLibrary.cxx:8345:21: warning: redundant string initialization [readability-redundant-string-init]
PWGDQ/Core/CutsLibrary.cxx:8421:10: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list]
PWGDQ/Core/CutsLibrary.h:123:23: warning: function 'o2::aod::dqcuts::parseJSONAnalysisCompositeCut' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
PWGDQ/Core/CutsLibrary.h:153:37: warning: function 'o2::aod::dqmlcuts::makeLabeledCutsMl' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
PWGDQ/Core/CutsLibrary.h:162:40: warning: redundant 'getCompositeCut' declaration [readability-redundant-declaration]
[0 more errors; see full log]

Full log here.

@njacazio
njacazio enabled auto-merge (squash) November 18, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants